home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
rkplus20.zip
/
RKPGKEY.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-02-08
|
3KB
|
103 lines
Program RkpGKey;
{
This is a sample program using rkPlus. It is a sample of a registration
key generation program that would be used by the programmer to create
registration keys to be distributed to registered users. The user would
then enter the registration key into a "branding" program (such as RkpBrand)
to create the key file. The key generation program itself would NOT be
distributed, as it would allow users to generate keys. This sample can
create a 1 or 2 month limited use demo key, a 1 year registration key
or an unlimited registration key, for the RkpDemo program.
}
Uses
Crt, Dos, RkPlus;
Const
RkpGKeyVer = '2.1';
MonthNames : Array[1..12] of String[3]
= ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
Var
kc : Char;
ey,em,dd,dw : Word;
Begin
OwnerCode := 'ArgleBarbWotsLeeb';
ProgramCode := 'RkpDemo Three';
KeyFile := 'RKPDEMO';
WriteLn('RkpGKey ' + RkpGKeyVer);
WriteLn('Registration Key Generation Program for RkpDemo 3.x');
WriteLn('(c) 1991 TrendSoft, Inc.');
WriteLn;
WriteLn('FOR INTERNAL USE ONLY!');
WriteLn('DO NOT DISTRIBUTE!');
WriteLn;
Write('Enter name of person to register : ');
ReadLn(Reg.Name1);
WriteLn;
WriteLn('[1] 1 month limited use demo key');
WriteLn('[2] 2 month limited use demo key');
WriteLn('[R] registration key (1 year)');
WriteLn('[U] unlimited registration key');
WriteLn;
Write('Type? ');
kc := UpCase(ReadKey);
WriteLn(kc);
WriteLn;
GetDate(ey,em,dd,dw);
If (kc = '1') then Begin
If (em = 12) then Begin
em := 1;
Inc(ey);
End Else
Inc(em);
WriteLn('Creating limited use demo key (will expire 1-',MonthNames[em],'-',ey,')');
Reg.Level := 0;
Reg.ExpYear := ey;
Reg.ExpMonth := em;
End Else If (kc = '2') then Begin
If (em = 11) then Begin
em := 1;
Inc(ey);
End Else If (em = 12) then Begin
em := 2;
Inc(ey);
End Else Begin
Inc(em,2);
End;
WriteLn('Creating limited use demo key (will expire 1-',MonthNames[em],'-',ey,')');
Reg.Level := 0;
Reg.ExpYear := ey;
Reg.ExpMonth := em;
End Else If (kc in ['R','r']) then Begin
If (em = 12) then Begin
em := 1;
Inc(ey);
End Else
Inc(em);
Inc(ey);
WriteLn('Creating registration key (will expire 1-',MonthNames[em],'-',ey,')');
Reg.Level := 1;
Reg.ExpYear := ey;
Reg.ExpMonth := em;
End Else Begin
WriteLn('Creating unlimited registration key');
Reg.Level := 1;
Reg.ExpYear := 0;
Reg.ExpMonth := 0;
End;
Reg.ID := 'RkpDemo';
Reg.Message := '(c) 1991 TrendSoft, Inc.';
Reg.Name2 := '';
Reg.Name3 := '';
CreateKey;
WriteLn;
WriteLn('Key is ',Reg.Key);
End.